def qwer(password):
    star = 0
    if any(c.isdigit() for c in password) == True:
        star += 1
    if any(c.islower() for c in password):
        star += 1
    if any(c.isupper() for c in password):
        star += 1
    if len(password) > 8:
        star += 1
    return star
password = list(map(str,input().split()))
print(qwer(password))
